package com.example.springboot2.oa.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.springboot2.oa.entity.TDepartment;
import com.example.springboot2.oa.mapper.TDepartmentMapper;
import com.example.springboot2.oa.service.ITDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author llfy
 * @since 2018-11-23
 */
@Service
public class TDepartmentServiceImpl extends ServiceImpl<TDepartmentMapper, TDepartment> implements ITDepartmentService {

    @Autowired
    private TDepartmentMapper departmentMapper;

    @Override
    public List<TDepartment> getDepartmentsByByParentID(int departmentId) {
        List<TDepartment> depts = departmentMapper.getAllByParentId(departmentId);
        return depts;
    }
}
